import React from 'react';
import {Table} from 'antd';
import {connect} from "dva";

class OrderForm extends React.Component {

  constructor(props){
    super(props);
    // this.formFields = [].concat([...props.formFields]);
    // this.formFields.splice(props.formFields.length-1,1);
    // this.formFields.map((item)=>{
    //   console.log(item)
    // });
    // const { dispatch} = this.props;
    // dispatch({type: 'orderInfo/userListReducer'})

  }
  myRenderTd = (text) => text;
  handleOk=(e)=>{
    e.preventDefault();

  };
  handleCancel=()=>{
    this.props.handleCancel();
  };

  render() {
    const {userInfo,data} = this.props;
    console.log("获取数据2=",userInfo)
    const columns = [
      {title: "ID",dataIndex: 'id',width:200,fixed:'left',render:(text,record)=>{return this.myRenderTd(text)}},
      {title: "NAME",dataIndex: 'name',width:200,fixed:'left',render:(text,record)=>{return this.myRenderTd(text)}},
      {title:  "行操作" ,width:100,fixed: 'right',key:"action",render:(text, record) => {
          return  (
            <span>
              <a color={"rgb(24, 144, 255)"} style={{cursor: 'pointer'}} > 详情</a>
            </span>
          )
        }}
    ];
    return (
     <div>
       <p>13213</p>
       <Table columns={columns} dataSource={data}/>
     </div>
    )
  }
}


// function mapStateToProps({orderInfo}) {
//   return {orderInfo}
// }

// export default connect(mapStateToProps)(Order);
export default (OrderForm);

// export default connect(({orderInfo}) => ({
//   orderInfo,
// }))(Order);
